package XiaoMi;


import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.LockSupport;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @leiwenkang 2018-01-17 13:19.
 */
public class Demo {
    public static void main(String[] args) throws Exception
    {
        final ReentrantLock lock = new ReentrantLock();

        Thread t = new Thread(new Runnable()
        {
            @Override
            public void run()
            {
                lock.lock();
                System.out.println("execute");
                lock.unlock();
            }
        });

        lock.lock();
        lock.lock();
        t.start();

        Thread.sleep(200);
        System.out.println("realse one once");

        lock.unlock();
        lock.unlock();
    }
}
